package servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.yunhe.dao.ReplyDao;
import cn.yunhe.dao.TopicDao;
import cn.yunhe.dao.impl.ReplyDaoImpl;
import cn.yunhe.dao.impl.TopicDaoImpl;
import cn.yunhe.entity.Reply;
import cn.yunhe.entity.Topic;

/**
 * Servlet implementation class ReplyPage
 */
@WebServlet("/ReplyPage")
public class ReplyPage extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ReplyPage() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
			
			
			
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}
	//查询当前板块下所有的帖子
	public  List<Topic>listAll(int bid){
		List<Topic> topic=new ArrayList<Topic>();
		TopicDao t =new TopicDaoImpl();
		 return topic=t.findTopicsByBoardId(bid);
				
	}
	public static void main(String[] args) {
		List<Topic> topic=new ArrayList<Topic>();
		TopicDao t =new TopicDaoImpl();
		  topic=t.findTopicsByBoardId(1);
		
	}
}
